package com.app.scale.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class SupplierListBean extends BaseListBean {


    private ArrayList<SupplierListData> list = new ArrayList<SupplierListData>();

    public ArrayList<SupplierListData> getList() {
        return list;
    }

    public void setList(ArrayList<SupplierListData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(SupplierListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrentPage() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<SupplierListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public SupplierListData getSupplier(){
        if(getList().size()>0 || getList()!= null){
            return getList().get(0);
        }else {
            return null;
        }
    }

}
